<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>

        <table width="600px" >
            <tr bgcolor="#EEEEEE" align="center" >
                <th width="120px">Name</th>
                <th width="120px">project_id</th>
                <th width="80px">summary</th>
                <th width="80px">End Date</th>
                <th width="80px">type</th>
                <th width="80px">Status</th>
            </tr>
                 
            <%
        String query="SELECT * FROM task";
        Connection db_conn = null;
        Statement statement = null;
        PreparedStatement pstmt;
        ResultSet rs;
        try{
             Class.forName("com.mysql.jdbc.Driver");
             String url= "jdbc:mysql://localhost:3306/db";
             db_conn = DriverManager.getConnection( url,"root", "root" );
             statement = db_conn.createStatement();  
             rs=statement.executeQuery(query);
             while (rs.next()) { // parse the results
                out.println("<tr bgcolor='"+"'"+"#FFFFFF'"+"'"+" align='"+"'"+"center"+">");
                out.println("<td>"+rs.getString("name")+"</td>");
                out.println("<td>"+rs.getString("project_id")+"</td>");
                out.println("<td>"+rs.getString("summary")+"</td>");
                out.println("<td>"+rs.getString("estimated_date")+"</td>");
                out.println("<td>"+rs.getString("type")+"</td>");  
               out.println("<td>"+rs.getString("status")+"</td>");  
                out.println("</tr>");
                }
            db_conn.close();
        }
        catch(SQLException e){
        e.printStackTrace();
           out.println("sql not found");
           out.println(e);
           }
        catch(ClassNotFoundException e){
        e.printStackTrace();
        out.println(e);
        }
   %>            

           
        </table>
   	
